package com.yuan.util.string;

/**
 * 字符工具类
 * @author YouYuan
 * @version 1.0
 * @CreateDate 2018/7/11 10:29
 * @UpdateDate 2018/7/11 10:29
 */
public class CharUtil {
    /**
     * 判断是否是16进制的字符
     * @param c
     * @return
     */
    public static boolean isHex(char c) {
        return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f');
    }

    /**
     * 判断是否英文字母
     * @param c
     * @return
     */
    public static boolean isLetter(char c) {
        return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
    }

    /**
     * 判断是否数字
     * @param c
     * @return
     */
    public static boolean isNum(char c) {
        return (c >= '0' && c <= '9');
    }
}
